package com.yj.suncity.collect.bean;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class CollectListBean {
	private String success;// ": "1",
	private String msg;// ": "获取信息成功",
	private List<CollectAdvBean> advData;// ": []
	private List<CollectActivityBean> activityData;// ": []
	private List<CollectOfferBean> offerData;// ": []
	private List<CollectHelpBean> helpData;// ": []
	private List<CollectGoodsBean> goodsData;// ": []

	public CollectListBean(JSONObject json) {
		this.success = json.optString("success");
		this.msg = json.optString("msg");
		this.advData = new ArrayList<CollectAdvBean>();
		this.activityData=new ArrayList<CollectActivityBean>();
		this.offerData=new ArrayList<CollectOfferBean>();
		this.helpData=new ArrayList<CollectHelpBean>();
		this.goodsData=new ArrayList<CollectGoodsBean>();
		
		JSONArray array = json.optJSONArray("data");
		if (array != null) {
			for (int i = 0; i < array.length(); i++) {
				JSONObject item = array.optJSONObject(i);
				if (item != null) {
					this.advData.add(new CollectAdvBean(item));
				}
			}
		}

		JSONArray array1 = json.optJSONArray("data");
		if (array1 != null) {
			for (int i = 0; i < array1.length(); i++) {
				JSONObject item = array1.optJSONObject(i);
				if (item != null) {
					this.activityData.add(new CollectActivityBean(item));
				}
			}
		}

		JSONArray array2 = json.optJSONArray("data");
		if (array2 != null) {
			for (int i = 0; i < array2.length(); i++) {
				JSONObject item = array2.optJSONObject(i);
				if (item != null) {
					this.offerData.add(new CollectOfferBean(item));
				}
			}
		}

		JSONArray array3 = json.optJSONArray("data");
		if (array3 != null) {
			for (int i = 0; i < array3.length(); i++) {
				JSONObject item = array3.optJSONObject(i);
				if (item != null) {
					this.helpData.add(new CollectHelpBean(item));
				}
			}
		}

		JSONArray array4 = json.optJSONArray("data");
		if (array4 != null) {
			for (int i = 0; i < array4.length(); i++) {
				JSONObject item = array4.optJSONObject(i);
				if (item != null) {
					this.goodsData.add(new CollectGoodsBean(item));
				}
			}
		}

	}

	public String getSuccess() {
		return success;
	}

	public String getMsg() {
		return msg;
	}

	public List<CollectAdvBean> getAdvData() {
		return advData;
	}

	public List<CollectActivityBean> getActivityData() {
		return activityData;
	}

	public List<CollectOfferBean> getOfferData() {
		return offerData;
	}

	public List<CollectHelpBean> getHelpData() {
		return helpData;
	}

	public List<CollectGoodsBean> getGoodsData() {
		return goodsData;
	}

}
